package com.qlk.odcinterface.dao.impl;

import com.qlk.common.dao.mybatis.BaseDao;
import com.qlk.odcinterface.dao.PmsProductPromotionItemDao;
import com.qlk.odcinterface.domain.PmsProductPromotionItem;
import com.qlk.odcinterface.domain.query.PmsProductPromotionItemQuery;

import java.util.List;
import org.springframework.stereotype.Repository;

/**
 * PmsProductPromotionItemDAO实现类<br/>
 * 对'单品促销明细表'表进行基本的操作
 * 
 * @author zhaoyanan
 * @version 2016-4-14 13:22:58
 * 
 */
@Repository
public class PmsProductPromotionItemDaoImpl extends BaseDao implements PmsProductPromotionItemDao {
    /** namespace */
    private final String namespace = PmsProductPromotionItemDaoImpl.class.getName();
    
    /**
     * {@inheritDoc}
     */
    public List<PmsProductPromotionItem> queryPmsProductPromotionItemList(PmsProductPromotionItemQuery queryBean) {
        return (List<PmsProductPromotionItem>) queryForList(namespace +".queryPmsProductPromotionItemList", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public boolean insert(PmsProductPromotionItem pmsProductPromotionItem) {
        return insert(namespace +".insert", pmsProductPromotionItem);
    }

    /**
     * {@inheritDoc}
     */
    public boolean update(PmsProductPromotionItem pmsProductPromotionItem) {
        return update(namespace +".update", pmsProductPromotionItem);
    }

    /**
     * {@inheritDoc}
     */
    public int queryPmsProductPromotionItemCount(PmsProductPromotionItemQuery queryBean) {
        return (Integer) queryForObject(namespace +".queryPmsProductPromotionItemCount", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public List<PmsProductPromotionItem> queryPmsProductPromotionItemListWithPage(PmsProductPromotionItemQuery queryBean) {
        return (List<PmsProductPromotionItem>) queryForList(namespace +".queryPmsProductPromotionItemListWithPage", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public boolean delete(PmsProductPromotionItem configuration) {
        return delete(namespace +".delete", configuration);
    }
    
    public boolean deletePmsProductPromotionItem(PmsProductPromotionItem configuration) {
        return delete(namespace +".deletePmsProductPromotionItem", configuration);
    }
    /**
     * {@inheritDoc}
     */
    public PmsProductPromotionItem getPmsProductPromotionItemById(Long id) {
        return (PmsProductPromotionItem) queryForObject(namespace +".getPmsProductPromotionItemById", id);
    } 
    
    /**
     * {@inheritDoc}
     */
    public boolean exist(PmsProductPromotionItem pmsProductPromotionItem) {
        int count = (Integer) queryForObject(namespace +".exist", pmsProductPromotionItem);
        return count > 0;
    }
}
